package com.base.controller;

import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.base.service.UsersService;

/**
 * 活动配置信息
 * 
 * @author f 优化日期：10-11
 *
 */
@Controller
@RequestMapping("/admin")
public class ActivitysIndexController {

	@Autowired
	private UsersService usersService; // 账户信息Service

	// 活动配置主页
	@RequestMapping("/activitys_index")
	public ModelAndView index(HttpSession session) {
		Object obj_id = session.getAttribute("adminUserId"); // 登录的用户ID
		if (obj_id == null) {
			return new ModelAndView("jsp/loginCheck"); // 未登录
		}
		return new ModelAndView("jsp/activitys_index", "users", usersService.selectByPrimaryKey((String) obj_id));
	}
}
